package com.zoro.barn.business.service.system.business.team.dao;

import com.zoro.barn.commons.db.annotations.MybatisMapper;
import com.zoro.barn.commons.db.annotations.NeedPage;
import com.zoro.barn.business.service.system.business.team.entity.BarnTeam;
import com.zoro.barn.business.service.system.business.team.entity.BarnTeamUserDto;

import java.util.List;

/**
 * @author zhaoxingwu
 */
@MybatisMapper
public interface BarnTeamMapper {
    /**
     * 动态条件查询
     *
     * @param barnTeam 查询条件
     * @return 查询结果
     */
    @NeedPage
    List<BarnTeam> query(BarnTeam barnTeam);

    /**
     * query by pid
     *
     * @param pid pid
     * @return result
     */
    BarnTeam getById(String pid);

    /**
     * insert a new data
     *
     * @param data data
     */
    void insert(BarnTeam data);

    /**
     * update a data by pid
     *
     * @param data data
     */
    void update(BarnTeam data);

    /**
     * 查询某个角team 的用户
     *
     * @param userDto {@link BarnTeamUserDto}
     * @return result
     */
    @NeedPage
    List<BarnTeamUserDto> getUsers(BarnTeamUserDto userDto);
}
